package com.itheima;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Demo1 {
    public static void main(String[] args) {
        HashMap<String, String> hm = new HashMap<>();

        hm.put("Tom", "java");
        hm.put("Kevin", "python");
        hm.put("Lily", "C++");
        hm.put("Lucy", "PHP");

        Set<String> set = hm.keySet();

        for (String key : set) {
            String value = hm.get(key);
            System.out.println(key + "--------" + value);
        }
        System.out.println("--------------------------");

        Set<Map.Entry<String, String>> entries = hm.entrySet();

        for (Map.Entry<String, String> entry : entries) {
            String key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key + "--------" + value);
        }
    }
}
